home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3DSet.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  9.5 KB  |  321 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DSet.a
  3. ;
  4. ;    Contains:    Q3Set types and routines                                            
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
  18. __QD3DSET__ SET 1
  19.  
  20.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  21.     include 'QD3D.a'
  22.     ENDIF
  23.  
  24. ; ******************************************************************************
  25. ; **                                                                             **
  26. ; **                                Set Routines                                 **
  27. ; **                                                                             **
  28. ; ****************************************************************************
  29.  
  30. ;
  31. ; extern TQ3SetObject Q3Set_New(void )
  32. ;
  33.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  34.         IMPORT_CFM_FUNCTION Q3Set_New
  35.     ENDIF
  36.  
  37. ;
  38. ; extern TQ3ObjectType Q3Set_GetType(TQ3SetObject theSet)
  39. ;
  40.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  41.         IMPORT_CFM_FUNCTION Q3Set_GetType
  42.     ENDIF
  43.  
  44. ;
  45. ; extern TQ3Status Q3Set_Add(TQ3SetObject theSet, TQ3ElementType theType, const void *data)
  46. ;
  47.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  48.         IMPORT_CFM_FUNCTION Q3Set_Add
  49.     ENDIF
  50.  
  51. ;
  52. ; extern TQ3Status Q3Set_Get(TQ3SetObject theSet, TQ3ElementType theType, void *data)
  53. ;
  54.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  55.         IMPORT_CFM_FUNCTION Q3Set_Get
  56.     ENDIF
  57.  
  58. ;
  59. ; extern TQ3Boolean Q3Set_Contains(TQ3SetObject theSet, TQ3ElementType theType)
  60. ;
  61.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  62.         IMPORT_CFM_FUNCTION Q3Set_Contains
  63.     ENDIF
  64.  
  65. ;
  66. ; extern TQ3Status Q3Set_Clear(TQ3SetObject theSet, TQ3ElementType theType)
  67. ;
  68.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  69.         IMPORT_CFM_FUNCTION Q3Set_Clear
  70.     ENDIF
  71.  
  72. ;
  73. ; extern TQ3Status Q3Set_Empty(TQ3SetObject target)
  74. ;
  75.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  76.         IMPORT_CFM_FUNCTION Q3Set_Empty
  77.     ENDIF
  78.  
  79. ; *  Iterating through all elements in a set
  80. ; *
  81. ; *  Pass in kQ3ElementTypeNone to get first type
  82. ; *  kQ3ElementTypeNone is returned when end of list is reached
  83.  
  84. ;
  85. ; extern TQ3Status Q3Set_GetNextElementType(TQ3SetObject theSet, TQ3ElementType *theType)
  86. ;
  87.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  88.         IMPORT_CFM_FUNCTION Q3Set_GetNextElementType
  89.     ENDIF
  90.  
  91.  
  92. ; ******************************************************************************
  93. ; **                                                                             **
  94. ; **                                Attribute Types                                 **
  95. ; **                                                                             **
  96. ; ****************************************************************************
  97.  
  98. ;  
  99. ; *    For the data types listed below, pass in a pointer to it in the _Add 
  100. ; *    and _Get calls.
  101. ; *
  102. ; *    For surface shader attributes, reference counts are incremented on 
  103. ; *    the _Add and _Get 
  104.  
  105.  
  106. ; typedef long                            TQ3AttributeTypes
  107.                                                             ; Data Type                
  108. kQ3AttributeTypeNone            EQU        0                    ; ---------                
  109. kQ3AttributeTypeSurfaceUV        EQU        1                    ; TQ3Param2D                
  110. kQ3AttributeTypeShadingUV        EQU        2                    ; TQ3Param2D                 
  111. kQ3AttributeTypeNormal            EQU        3                    ; TQ3Vector3D                 
  112. kQ3AttributeTypeAmbientCoefficient EQU    4                    ; float                     
  113. kQ3AttributeTypeDiffuseColor    EQU        5                    ; TQ3ColorRGB                
  114. kQ3AttributeTypeSpecularColor    EQU        6                    ; TQ3ColorRGB                
  115. kQ3AttributeTypeSpecularControl    EQU        7                    ; float                    
  116. kQ3AttributeTypeTransparencyColor EQU    8                    ; TQ3ColorRGB                
  117. kQ3AttributeTypeSurfaceTangent    EQU        9                    ; TQ3Tangent2D              
  118. kQ3AttributeTypeHighlightState    EQU        10                    ; TQ3Switch                 
  119. kQ3AttributeTypeSurfaceShader    EQU        11                    ; TQ3SurfaceShaderObject    
  120. kQ3AttributeTypeNumTypes        EQU        12
  121. ; typedef TQ3ElementType                 TQ3AttributeType
  122.  
  123. ; ******************************************************************************
  124. ; **                                                                             **
  125. ; **                                Attribute Drawing                             **
  126. ; **                                                                             **
  127. ; ****************************************************************************
  128.  
  129. ;
  130. ; extern TQ3Status Q3Attribute_Submit(TQ3AttributeType attributeType, const void *data, TQ3ViewObject view)
  131. ;
  132.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  133.         IMPORT_CFM_FUNCTION Q3Attribute_Submit
  134.     ENDIF
  135.  
  136.  
  137. ; ******************************************************************************
  138. ; **                                                                             **
  139. ; **                            AttributeSet Routines                             **
  140. ; **                                                                             **
  141. ; ****************************************************************************
  142.  
  143. ;
  144. ; extern TQ3AttributeSet Q3AttributeSet_New(void )
  145. ;
  146.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION Q3AttributeSet_New
  148.     ENDIF
  149.  
  150. ;
  151. ; extern TQ3Status Q3AttributeSet_Add(TQ3AttributeSet attributeSet, TQ3AttributeType theType, const void *data)
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  154.         IMPORT_CFM_FUNCTION Q3AttributeSet_Add
  155.     ENDIF
  156.  
  157. ;
  158. ; extern TQ3Boolean Q3AttributeSet_Contains(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
  159. ;
  160.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  161.         IMPORT_CFM_FUNCTION Q3AttributeSet_Contains
  162.     ENDIF
  163.  
  164. ;
  165. ; extern TQ3Status Q3AttributeSet_Get(TQ3AttributeSet attributeSet, TQ3AttributeType theType, void *data)
  166. ;
  167.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION Q3AttributeSet_Get
  169.     ENDIF
  170.  
  171. ;
  172. ; extern TQ3Status Q3AttributeSet_Clear(TQ3AttributeSet attributeSet, TQ3AttributeType theType)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION Q3AttributeSet_Clear
  176.     ENDIF
  177.  
  178. ;
  179. ; extern TQ3Status Q3AttributeSet_Empty(TQ3AttributeSet target)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  182.         IMPORT_CFM_FUNCTION Q3AttributeSet_Empty
  183.     ENDIF
  184.  
  185. ; * Q3AttributeSet_GetNextAttributeType
  186. ; *
  187. ; * Pass in kQ3AttributeTypeNone to get first type
  188. ; * kQ3AttributeTypeNone is returned when end of list is reached
  189.  
  190. ;
  191. ; extern TQ3Status Q3AttributeSet_GetNextAttributeType(TQ3AttributeSet source, TQ3AttributeType *theType)
  192. ;
  193.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION Q3AttributeSet_GetNextAttributeType
  195.     ENDIF
  196.  
  197. ;
  198. ; extern TQ3Status Q3AttributeSet_Submit(TQ3AttributeSet attributeSet, TQ3ViewObject view)
  199. ;
  200.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION Q3AttributeSet_Submit
  202.     ENDIF
  203.  
  204. ; * Inherit from parent->child into result
  205. ; *    Result attributes are:
  206. ; *        all child attributes + all parent attributes NOT in the child
  207.  
  208. ;
  209. ; extern TQ3Status Q3AttributeSet_Inherit(TQ3AttributeSet parent, TQ3AttributeSet child, TQ3AttributeSet result)
  210. ;
  211.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  212.         IMPORT_CFM_FUNCTION Q3AttributeSet_Inherit
  213.     ENDIF
  214.  
  215.  
  216. ; ******************************************************************************
  217. ; **                                                                             **
  218. ; **                            Custom Element Registration                         **
  219. ; **                                                                             **
  220. ; ****************************************************************************
  221.  
  222. ; * Element Methods - 
  223. ; *
  224. ; *         When you create a custom element, you control what structures are 
  225. ; *        passed around the API. For example, you may allow the Q3Set_Add call 
  226. ; *        take one type of argument, store your element internally in some 
  227. ; *        abstract data type, and have the Q3Set_Get call take a different 
  228. ; *        argument.
  229. ; *
  230. ; *        For example:
  231. ; *            
  232. ; *        There are four calls which at some point will copy an element:
  233. ; *
  234. ; *        Q3Set_Add (copied from Application memory to QuickDraw3D memory)
  235. ; *        Q3Set_Get (copied from QuickDraw3D memory to Application memory)
  236. ; *        Q3Object_Duplicate (all elements are copied internally)
  237. ; *        Q3AttributeSet_Inherit (all elements are copied internally)
  238. ; *
  239. ; *         Either CopyAdd or CopyReplace is called during the "_Add" call.
  240. ; *            - CopyAdd is destructive and should assume "toElement" is garbage
  241. ; *            - CopyReplace is replacing an existing element.
  242. ; *
  243. ; *         CopyGet is called during the "_Get" call.
  244. ; *
  245. ; *         CopyDuplicate is called to duplicate an element's internal structure.
  246. ; *
  247. ; * Attributes Methods - 
  248. ; *
  249. ; *        For copying data while Inheriting. Element methods are used
  250. ; *        at all other times.
  251. ; *    
  252. ; *         CopyInherit is called to duplicate an element's internal structure 
  253. ; *            during inheritance. You should make this as fast as possible.
  254. ; *            (for example, if your custom element contains objects, you
  255. ; *             should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
  256. ; *            
  257. ; *        The ElementDelete method will be called for all of your elements 
  258. ; *        copied around via CopyAdd, CopyReplace, CopyDuplicate, and 
  259. ; *        CopyInherit.
  260. ; *        If CopyGet allocates any memory in it's destination, it is up to the 
  261. ; *        application to delete it on its side.
  262.  
  263.  
  264. kQ3XMethodTypeElementCopyAdd    EQU        'ecpa'
  265. kQ3XMethodTypeElementCopyReplace EQU    'ecpr'
  266. kQ3XMethodTypeElementCopyGet    EQU        'ecpg'
  267. kQ3XMethodTypeElementCopyDuplicate EQU    'eccd'
  268. kQ3XMethodTypeElementDelete        EQU        'ecpl'
  269. ;
  270. ; extern TQ3XObjectClass Q3XElementClass_Register(TQ3ElementType *elementType, const char *name, unsigned long sizeOfElement, TQ3XMetaHandler metaHandler)
  271. ;
  272.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  273.         IMPORT_CFM_FUNCTION Q3XElementClass_Register
  274.     ENDIF
  275.  
  276. ;
  277. ; extern TQ3Status Q3XElementType_GetElementSize(TQ3ElementType elementType, unsigned long *sizeOfElement)
  278. ;
  279.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  280.         IMPORT_CFM_FUNCTION Q3XElementType_GetElementSize
  281.     ENDIF
  282.  
  283.  
  284. ; ******************************************************************************
  285. ; **                                                                             **
  286. ; **                        Custom Attribute Registration                         **
  287. ; **                                                                             **
  288. ; ****************************************************************************
  289.  
  290. ; typedef TQ3Boolean                     TQ3XAttributeInheritMethod
  291.  
  292. ;  return kQ3True or kQ3False in your metahandler 
  293. ;
  294. ; extern TQ3XObjectClass Q3XAttributeClass_Register(TQ3AttributeType *attributeType, const char *creatorName, unsigned long sizeOfElement, TQ3XMetaHandler metaHandler)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION Q3XAttributeClass_Register
  298.     ENDIF
  299.  
  300. ; *    Version 1.5
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.     ENDIF ; __QD3DSET__ 
  309.  
  310.